package com.jt.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component

public class User {

    @Autowired
    @Qualifier("dog")
    private Pet pet;

    public void say() {
        pet.hello();
    }
}
